3.1.59 \(\int e^{x^2} \sin (a+b x) \, dx\) [59]

Optimal. Leaf size=81 \[ \frac {1}{4} i e^{-i a+\frac {b^2}{4}} \sqrt {\pi } \text {Erfi}\left (\frac {1}{2} (-i b+2 x)\right )-\frac {1}{4} i e^{i a+\frac {b^2}{4}} \sqrt {\pi } \text {Erfi}\left (\frac {1}{2} (i b+2 x)\right ) \]

[Out]

-1/4*I*exp(-I*a+1/4*b^2)*erfi(1/2*I*b-x)*Pi^(1/2)-1/4*I*exp(I*a+1/4*b^2)*erfi(1/2*I*b+x)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4560, 2266, 2235} \begin {gather*} \frac {1}{4} i \sqrt {\pi } e^{\frac {b^2}{4}-i a} \text {Erfi}\left (\frac {1}{2} (2 x-i b)\right )-\frac {1}{4} i \sqrt {\pi } e^{\frac {b^2}{4}+i a} \text {Erfi}\left (\frac {1}{2} (2 x+i b)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[E^x^2*Sin[a + b*x],x]

[Out]

(I/4)*E^((-I)*a + b^2/4)*Sqrt[Pi]*Erfi[((-I)*b + 2*x)/2] - (I/4)*E^(I*a + b^2/4)*Sqrt[Pi]*Erfi[(I*b + 2*x)/2]

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 4560

Int[(F_)^(u_)*Sin[v_]^(n_.), x_Symbol] :> Int[ExpandTrigToExp[F^u, Sin[v]^n, x], x] /; FreeQ[F, x] && (LinearQ
[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, x] || PolyQ[v, x, 2]) && IGtQ[n, 0]

Rubi steps

\begin {align*} \int e^{x^2} \sin (a+b x) \, dx &=\int \left (\frac {1}{2} i e^{-i a-i b x+x^2}-\frac {1}{2} i e^{i a+i b x+x^2}\right ) \, dx\\ &=\frac {1}{2} i \int e^{-i a-i b x+x^2} \, dx-\frac {1}{2} i \int e^{i a+i b x+x^2} \, dx\\ &=\frac {1}{2} \left (i e^{-i a+\frac {b^2}{4}}\right ) \int e^{\frac {1}{4} (-i b+2 x)^2} \, dx-\frac {1}{2} \left (i e^{i a+\frac {b^2}{4}}\right ) \int e^{\frac {1}{4} (i b+2 x)^2} \, dx\\ &=\frac {1}{4} i e^{-i a+\frac {b^2}{4}} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (-i b+2 x)\right )-\frac {1}{4} i e^{i a+\frac {b^2}{4}} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (i b+2 x)\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 81, normalized size = 1.00 \begin {gather*} \frac {1}{4} e^{\frac {b^2}{4}} \sqrt {\pi } \left (\cos (a) \text {Erf}\left (\frac {b}{2}-i x\right )+\cos (a) \text {Erf}\left (\frac {b}{2}+i x\right )+\left (\text {Erfi}\left (\frac {1}{2} (-i b+2 x)\right )+\text {Erfi}\left (\frac {1}{2} (i b+2 x)\right )\right ) \sin (a)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[E^x^2*Sin[a + b*x],x]

[Out]

(E^(b^2/4)*Sqrt[Pi]*(Cos[a]*Erf[b/2 - I*x] + Cos[a]*Erf[b/2 + I*x] + (Erfi[((-I)*b + 2*x)/2] + Erfi[(I*b + 2*x
)/2])*Sin[a]))/4

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 52, normalized size = 0.64

method result size
risch \(\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {b^{2}}{4}} {\mathrm e}^{i a} \erf \left (-i x +\frac {b}{2}\right )}{4}+\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {b^{2}}{4}} {\mathrm e}^{-i a} \erf \left (i x +\frac {b}{2}\right )}{4}\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x^2)*sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/4*Pi^(1/2)*exp(1/4*b^2)*exp(I*a)*erf(-I*x+1/2*b)+1/4*Pi^(1/2)*exp(1/4*b^2)*exp(-I*a)*erf(I*x+1/2*b)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 51, normalized size = 0.63 \begin {gather*} \frac {1}{4} \, \sqrt {\pi } {\left ({\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \operatorname {erf}\left (\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2}\right )} - {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \operatorname {erf}\left (-\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2}\right )}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(b*x+a),x, algorithm="maxima")

[Out]

1/4*sqrt(pi)*((cos(a) - I*sin(a))*erf(1/2*b + I*x)*e^(1/4*b^2) - (cos(a) + I*sin(a))*erf(-1/2*b + I*x)*e^(1/4*
b^2))

________________________________________________________________________________________

Fricas [A]
time = 1.31, size = 45, normalized size = 0.56 \begin {gather*} -\frac {1}{4} \, \sqrt {\pi } {\left (\operatorname {erf}\left (-\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2} + i \, a\right )} - \operatorname {erf}\left (\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2} - i \, a\right )}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(b*x+a),x, algorithm="fricas")

[Out]

-1/4*sqrt(pi)*(erf(-1/2*b + I*x)*e^(1/4*b^2 + I*a) - erf(1/2*b + I*x)*e^(1/4*b^2 - I*a))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int e^{x^{2}} \sin {\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x**2)*sin(b*x+a),x)

[Out]

Integral(exp(x**2)*sin(a + b*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(b*x+a),x, algorithm="giac")

[Out]

integrate(e^(x^2)*sin(b*x + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {e}}^{x^2}\,\sin \left (a+b\,x\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x^2)*sin(a + b*x),x)

[Out]

int(exp(x^2)*sin(a + b*x), x)

________________________________________________________________________________________